Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add discrete callbacks #331

Merged
merged 6 commits into from
Nov 14, 2023
Merged

Add discrete callbacks #331

merged 6 commits into from
Nov 14, 2023

Conversation

xtalax
Copy link
Member

@xtalax xtalax commented Oct 19, 2023

Adds a type MOLDiscCallback which is used to write functions that operate on the discrete space during discretization. Usual caveats on functions operating on symbols apply.

Usage:

...

    cb = MOLDiscCallback((s, p) -> prod(p), [0.1, pi])
    a_cb = cb.sym
    cbeq = Dt(u(t, x)) ~ a_cb*Dxx(u(t, x))
...
    cbpdesys = PDESystem(cbeq, bcs, domains, [t, x], [u(t, x)], callbacks = [cb])
...

Replaces instances of the symbol with calls to the chosen callback function, where s is the DiscreteSpace object and p are your chosen parameters (Different to ps of the PDESys)

@codecov
Copy link

codecov bot commented Oct 19, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (e2974ea) 86.22% compared to head (7966aa2) 86.27%.

Files Patch % Lines
src/system_parsing/pde_system_transformation.jl 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #331      +/-   ##
==========================================
+ Coverage   86.22%   86.27%   +0.05%     
==========================================
  Files          38       40       +2     
  Lines        1742     1756      +14     
==========================================
+ Hits         1502     1515      +13     
- Misses        240      241       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@xtalax xtalax merged commit 3532dad into SciML:master Nov 14, 2023
40 of 43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant